int** flipAndInvertImage(int** image, int imageSize, int* imageColSize, int* ret)
{ 
    int i = 0;
    int j = 0;
    for (i = 0; i < imageSize; i++) {
        int l = 0;
        int r = imageSize - 1;

        while (l < r) {
            int tmp = image[i][l];
            image[i][l] = image[i][r];
            image[i][r] = tmp;
            l++; r--;
        }
    }
    for (i = 0; i < imageSize; i++) {
        for (j = 0; j < imageSize; j++) {
            image[i][j] = 1 - image[i][j];
        }
    }
    *returnSize = imageSize;
    *returnColumnSizes = imageColSize;
    return image;
}